package com.sdy.service.Impl;

import com.sdy.dao.mysql.OrderMapper;
import com.sdy.po.Order;
import com.sdy.po.OrderItem;
import com.sdy.po.Product;
import com.sdy.po.Specification;
import com.sdy.service.OrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Resource
    OrderMapper orderMapper;

    @Override
    public List<Order> getAll() {
        return null;
    }

    @Override
    public OrderItem getOne() {
        return null;
    }

    @Override
    public Boolean update(Order order) {
        return null;
    }

    @Override
    public Boolean insert(Order order) {
        return null;
    }

    @Override
    public Boolean delete(Integer id) {
        return null;
    }

    /**
     * 根据公司id获取订单信息
     * @param id
     * @return
     */
    @Override
    public List<Order> getListByCompanyId(Integer id) {
        List<Order> orderList =orderMapper.getListByCompanyId(id);
        for (Order order:orderList) {
            order.specificOrder();
        }
        return orderList;
    }
}
